<template>
	<view>
		<page-head :title="'我的邀请'" :headtype="2"></page-head>
		<view class="recoblock">
			<view class="recoitem blockbg marginAuto" v-for="(item,index) in invitedata" :key="index">
				<view class="recoitemhead">
					<image style="width:110rpx;height:110rpx;border-radius: 50%;" v-if="item.avatar == ''" src="@/static/logo.png" mode="aspectFill"></image>
					<image style="width:110rpx;height:110rpx;border-radius: 50%;" v-if="item.avatar != ''" :src="URLimg + item.avatar" mode="aspectFill"></image>
				</view>
				<view class="recoiteml">
					<view class="recoiteml-title" v-text="item.nick"></view>
					<view class="recoiteml-time">注册时间：{{ item.create_time }}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				URLimg:this.URLimg,
				page:1,
				invitedata:[]
			};
		},
		onLoad() {
			this.initData()
		},
		methods: {
			initData(){
				let sendData = {};
				this.apifun.unirequest('/api/user/getInviteShop','post',sendData,(res)=>{
					// console.log(res)
					if(res.code === 200){
						let datas = res.data;
						this.invitedata = datas;
					}else{
						this.apifun.toast(res.msg)
					}
				})
			}
		},
		onReachBottom() {
			this.page++;
			this.initData();
		},
		onPullDownRefresh() {
			this.page = 1;
			this.goodsdata = [];
			this.initData();
			uni.stopPullDownRefresh();
		},
	};
</script>

<style scoped lang="scss">
	page{
		padding-bottom: 150rpx;
	}
	.blockbg {
		width: 640rpx;
		border-radius: 20rpx;
		background-color: #fff;
		padding: 24rpx;
		margin-top: 20rpx;
	}
	.recoblock{
		.recoitem{
			margin-top:20rpx;
			display:flex;
			.recoitemhead{
				width:110rpx;
				height: 110rpx;
			}
			.recoiteml{
				margin-left: 28rpx;
				.recoiteml-title{
					font-size: 30rpx;
					color:#333333;
					margin-top: 10rpx;
				}
				.recoiteml-time{
					font-size:24rpx;
					color:#999999;
					line-height: 44rpx;
					margin-top: 10rpx;
				}
			}
			
		}
	}
</style>